package com.yanqu.road.entity.kuang.battle;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.DataStatus;
import com.yanqu.road.entity.FieldTypeAnnotation;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

@FieldTypeAnnotation(tableName = "t_c_kuang_battle_data")
public class CrossKuangBattleData extends DataObject {

    @FieldTypeAnnotation(desc = "周次id")
    private int weekId;

    @FieldTypeAnnotation(desc = "分组Id")
    private int groupId;

    @FieldTypeAnnotation(desc = "轮次,记录零点时间")
    private int round;

    @FieldTypeAnnotation(desc = "活动结束处理状态")
    private boolean battleEndHandle;

    @FieldTypeAnnotation(desc = "榜单自动发放状态")
    private boolean rankReward;

    @FieldTypeAnnotation(desc = "宗门积分")
    private Map<Integer, Map<Integer, CrossKuangBattleCampScoreRecord>> campScoreRecordMap = new ConcurrentHashMap<>();

    @FieldTypeAnnotation(desc = "更新时间,检测活动状态")
    private long updateTime;

    public int getWeekId() {
        return weekId;
    }

    public void setWeekId(int weekId) {
        if (this.weekId != weekId) {
            this.weekId = weekId;
            setOp(DataStatus.Update);
        }
    }

    public int getGroupId() {
        return groupId;
    }

    public void setGroupId(int groupId) {
        if (this.groupId != groupId) {
            this.groupId = groupId;
            setOp(DataStatus.Update);
        }
    }

    public int getRound() {
        return round;
    }

    public void setRound(int round) {
        if (this.round != round) {
            this.round = round;
            setOp(DataStatus.Update);
        }
    }

    public boolean isBattleEndHandle() {
        return battleEndHandle;
    }

    public void setBattleEndHandle(boolean battleEndHandle) {
        if (this.battleEndHandle != battleEndHandle) {
            this.battleEndHandle = battleEndHandle;
            setOp(DataStatus.Update);
        }
    }

    public boolean isRankReward() {
        return rankReward;
    }

    public void setRankReward(boolean rankReward) {
        if (this.rankReward != rankReward) {
            this.rankReward = rankReward;
            setOp(DataStatus.Update);
        }
    }

    public Map<Integer, Map<Integer, CrossKuangBattleCampScoreRecord>> getCampScoreRecordMap() {
        return campScoreRecordMap;
    }

    public void setCampScoreRecordMap(Map<Integer, Map<Integer, CrossKuangBattleCampScoreRecord>> campScoreRecordMap) {
        if (campScoreRecordMap == null) {
            return;
        }
        this.campScoreRecordMap = campScoreRecordMap;
        setOp(DataStatus.Update);
    }

    public long getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(long updateTime) {
        if (this.updateTime != updateTime) {
            this.updateTime = updateTime;
            setOp(DataStatus.Update);
        }
    }
}
